<%@page import="form.ValidationNewPatient"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<jsp:useBean id="patient" scope="request" class="beans.Patient"/>
<jsp:useBean id="erreur" scope="request" class="beans.Erreur"/>
<jsp:useBean id="manager" scope="session" class="manager.Manager"/>


<%
if(request.getParameter("submit") != null)
{
	boolean res = ValidationNewPatient.form(request, patient, erreur);
	if (res)
	{
		out.println("<p>Enregistrement reussi</p>");
		patient.setNom("");
		patient.setPrenom("");
		patient.setTaille(null);
		patient.setPoids(null);
		patient.setAge(null);
	}
}
%>

<form>

<table>
	<tr>
		<td>Nom :</td>
		<td><input type="text" name="nom" value="${patient.nom}" /></td>
		<td>${erreur.err.nom}</td>
	</tr>
	<tr>
		<td>Prenom:</td>
		<td><input type="text" name="prenom" value="${patient.prenom}" /></td>
		<td>${erreur.err.prenom}</td>
	</tr>
	<tr>
		<td>Taille:</td>
		<td><input type="text" name="taille" value="${patient.taille}" /></td>
		<td>${erreur.err.taille}</td>
	</tr>
	<tr>
		<td>Poids:</td>
		<td><input type="text" name="poids" value="${patient.poids}" /></td>
		<td>${erreur.err.poids}</td>
	</tr>
	<tr>
		<td>Age:</td>
		<td><input type="text" name="age" value="${patient.age}" /></td>
		<td>${erreur.err.age}</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td><input type="submit" name="submit" value="Enregistrer" /></td>
	</tr>
</table>

</form>